﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            string frompath = "C:\\Users\\Administrator\\Desktop\\新建文件夹\\222.jpg";
            string topath = "C:\\Users\\Administrator\\Desktop\\333\\333.jpg";
            System.Drawing.Image image = System.Drawing.Image.FromFile(frompath);
            int height = Convert.ToInt32(image.Height * 0.9);


            YouWei.Utility.ImageHelper.CaptureImage(frompath, 0, 0, topath, image.Width, height);

        }

        private List<FileInfo> GetFile()
        {
            List<FileInfo> list = new List<FileInfo>();
            string path = string.Format("{0}/wx", Application.StartupPath);
            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }
            DirectoryInfo di = new DirectoryInfo(path);
            //找到该目录下的文件 
            FileInfo[] fis = di.GetFiles();
            foreach (FileInfo fi in fis)
            {
                list.Add(fi);

            }
            return list;
        }
    }
}
